﻿$(function () {
    var pickerOptions = {
        appendText: "dd/mm/yyyy",
        defaultDate: +5,
        showOtherMonths:true
    };
    $('#search .input input.start').datepicker(pickerOptions);
    $('#search .input input.end').datepicker(pickerOptions);
});

function showstartdatepicker() {
    $('#search .input input.start').datepicker('show');
}
function showenddatepicker() {
    $('#search .input input.end').datepicker('show');
}

function showDialog(id) {
    $("#" + id).css('display', 'block');
}

function hideDialog(id) {
    $("#" + id).css('display', 'none');
}

$(function () {
    $('#selectOrigin').click(function () {
        showDialog('dialog-origin');
    });
});
$(function () {
    $('#selectDestination').click(function () {
        showDialog('dialog-destination');
    });
});
function search() {
    alert("ddf");
    window.location.replace("/Search/select");
}

    $(document).ready(function () {

        $('#dialog-origin ul li a').click(function () {
            $('#origin').val(this.innerHTML);
            hideDialog('dialog-origin');
        });

        $('#dialog-destination ul li a').click(function () {
            $('#destination').val(this.innerHTML);
            hideDialog('dialog-destination');
        });
    });